/**  
 * All rights Reserved, Designed By www.tydic.com
 * @Title:  SpringQuartzJobFactory.java   
 * @Package com.axin.common.quartz   
 * @Description:    TODO(用一句话描述该文件做什么)   
 * @author: axin     
 * @date:   2019年3月31日 下午9:24:28   
 * @version V1.0 
 * @Copyright: 2019 www.hao456.top Inc. All rights reserved. 
 */
package com.axin.common.quartz;

import org.quartz.spi.TriggerFiredBundle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.scheduling.quartz.SpringBeanJobFactory;

/**   
 * @Description: 此类将Job纳入Spring容器管理 
 * @ClassName:  SpringQuartzJobFactory
 * @author:  Axin 
 * @date:   2019年3月31日 下午9:24:28   
 * @Copyright: 2019 www.hao456.top Inc. All rights reserved. 
 */
public class SpringQuartzJobFactory extends SpringBeanJobFactory {

	
	@Autowired
    private AutowireCapableBeanFactory beanFactory;
	
	/* (non-Javadoc)
	 * @see org.springframework.scheduling.quartz.SpringBeanJobFactory#createJobInstance(org.quartz.spi.TriggerFiredBundle)
	 */
	@Override
	protected Object createJobInstance(TriggerFiredBundle bundle) throws Exception {
		Object obj = super.createJobInstance(bundle);
        beanFactory.autowireBean(obj);
        return obj;
	}
	
	
	

}
